package com.shg.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.shg.bean.Online;
import com.shg.service.OnlineService;

@Service
public class OnlineServiceBean extends BasiceDaoImpl<Online> implements OnlineService {


	/**
	 * 查询店铺的客服人员
	 * @param shopId 店铺的ID
	 * @return
	 * @throws Exception
	 */
	public List<Online> getOnline(String shopId)throws Exception{
		String sql="from Online where shop='"+shopId+"'";
		List<Online> list = sessionFactory.getCurrentSession().createQuery(sql).list();
		return list;
	}

	public void removeOnline(Online online) throws Exception {
		String sql="delete from Online where id='"+online.getId()+"'";
		sessionFactory.getCurrentSession().createQuery(sql).executeUpdate();
	}
}
